﻿using System;
using UnityEngine;

// Token: 0x0200032E RID: 814
public class AssetBundleLoadAssetOperationFull : AssetBundleLoadAssetOperation
{
	// Token: 0x06001486 RID: 5254 RVA: 0x0008EC68 File Offset: 0x0008CE68
	public AssetBundleLoadAssetOperationFull(string bundleName, string assetName, Type type, string manifestAssetBundleName)
	{
		this.m_AssetBundleName = bundleName;
		this.m_AssetName = assetName;
		this.m_Type = type;
		this.m_ManifestAssetBundleName = manifestAssetBundleName;
	}

	// Token: 0x06001487 RID: 5255 RVA: 0x0008EC90 File Offset: 0x0008CE90
	public override bool IsEmpty()
	{
		return this.m_Request == null || !this.m_Request.isDone || this.m_Request.asset == null;
	}

	// Token: 0x06001488 RID: 5256 RVA: 0x0008ECC4 File Offset: 0x0008CEC4
	public override T GetAsset<T>()
	{
		if (this.m_Request != null && this.m_Request.isDone)
		{
			return this.m_Request.asset as T;
		}
		return (T)((object)null);
	}

	// Token: 0x06001489 RID: 5257 RVA: 0x0008ED00 File Offset: 0x0008CF00
	public override T[] GetAllAssets<T>()
	{
		if (this.m_Request != null && this.m_Request.isDone)
		{
			T[] array = new T[this.m_Request.allAssets.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = (this.m_Request.allAssets[i] as T);
			}
			return array;
		}
		return null;
	}

	// Token: 0x0600148A RID: 5258 RVA: 0x0008ED70 File Offset: 0x0008CF70
	public override bool Update()
	{
		if (this.m_Request != null)
		{
			return false;
		}
		LoadedAssetBundle loadedAssetBundle = AssetBundleManager.GetLoadedAssetBundle(this.m_AssetBundleName, out this.m_DownloadingError, this.m_ManifestAssetBundleName);
		if (loadedAssetBundle != null)
		{
			if (loadedAssetBundle.m_AssetBundle)
			{
				if (this.m_AssetName.IsNullOrEmpty())
				{
					this.m_Request = loadedAssetBundle.m_AssetBundle.LoadAllAssetsAsync(this.m_Type);
				}
				else
				{
					this.m_Request = loadedAssetBundle.m_AssetBundle.LoadAssetAsync(this.m_AssetName, this.m_Type);
				}
			}
			return false;
		}
		return true;
	}

	// Token: 0x0600148B RID: 5259 RVA: 0x0008EE04 File Offset: 0x0008D004
	public override bool IsDone()
	{
		if (this.m_Request == null && this.m_DownloadingError != null)
		{
			GlobalData.Debug_LogError(this.m_DownloadingError);
			return true;
		}
		return this.m_Request != null && this.m_Request.isDone;
	}

	// Token: 0x04001900 RID: 6400
	protected string m_AssetBundleName;

	// Token: 0x04001901 RID: 6401
	protected string m_AssetName;

	// Token: 0x04001902 RID: 6402
	protected string m_ManifestAssetBundleName;

	// Token: 0x04001903 RID: 6403
	protected Type m_Type;

	// Token: 0x04001904 RID: 6404
	protected string m_DownloadingError;

	// Token: 0x04001905 RID: 6405
	protected AssetBundleRequest m_Request;
}
